package zoo.reviewboard.user.dao;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.support.SqlSessionDaoSupport;

import zoo.reviewboard.user.domain.ProductReviewBoardCommand;

public class ProductReviewBoardDaoImpl extends SqlSessionDaoSupport implements ProductReviewBoardDao{

	@Override
	public List<ProductReviewBoardCommand> selectReviewList(Map<String, Object> map) {
		List<ProductReviewBoardCommand> list = getSqlSession().selectList("selectReviewList", map);
		return list;
	}

	@Override
	public int selectReviewCount(Map<String, Object> map) {
		return (Integer)getSqlSession().selectOne("selectReviewCount", map);
	}

	@Override
	public void insertReview(ProductReviewBoardCommand board) {
		getSqlSession().insert("insertReview",board);
		
	}

	@Override
	public ProductReviewBoardCommand selectReview(Integer seq) {
		ProductReviewBoardCommand command = (ProductReviewBoardCommand)getSqlSession().selectOne("selectReview", seq);
		return command;
	}

	@Override
	public void updateReviewHit(Integer seq) {
		getSqlSession().update("updateHitReview",seq);
	}

	@Override
	public void updateReview(ProductReviewBoardCommand board) {
		getSqlSession().update("updateReview",board);
		
	}

	@Override
	public void deleteReview(Integer seq) {
		getSqlSession().delete("deleteReview",seq);
	}
}
